$OpenBSD: patch-gconf_GConf_Client_cs,v 1.1 2016/11/09 11:18:37 ajacoutot Exp $

From e9d06b56a54dcd399d1d3eaaf62bdacb7e07084d Mon Sep 17 00:00:00 2001
From: Mirco Bauer <meebey@meebey.net>
Date: Sat, 2 Mar 2013 13:44:46 +0100
Subject: [PATCH] Explicitly initialize D-Bus GLib threading

--- gconf/GConf/Client.cs.orig	Sat Oct  9 20:01:29 2010
+++ gconf/GConf/Client.cs	Wed Nov  9 11:49:28 2016
@@ -31,6 +31,17 @@ namespace GConf
 		[DllImport("gconf-2")]
 		static extern IntPtr gconf_client_get_default ();
 
+		[DllImport("dbus-glib-1")]
+		static extern void dbus_g_thread_init ();
+
+		static Client ()
+		{
+			// HACK: we have to initialize dbus' threading else GConf with its
+			// dbus backend will not be thread safe and SEGVs in our face, see:
+			// https://bugzilla.gnome.org/show_bug.cgi?id=683830
+			dbus_g_thread_init();
+		}
+
 		public Client ()
 		{
 			Initialize ();
